package com.guigu.controller.manufacture;


import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.guigu.pojo.manufacture.MProcedureModule;
import com.guigu.service.manufacture.MProcedureModuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Mr.Zhang
 * @since 2024-12-06
 */
@Controller
@RequestMapping("/m-procedure-module")
public class MProcedureModuleController {

    @Autowired
    private MProcedureModuleService procedureModuleService;

    @GetMapping("/MProcedureModuleListReviewSub")
    public String MProcedureModuleListReviewSub(){
        return "jsp/manufacture/e/MProcedureModuleListReviewSub";
    }

    @GetMapping("/initialModule")
    @ResponseBody
    public ArrayList<MProcedureModule> initialModule(HttpServletRequest req){
        Integer id = StringUtils.isNotBlank(req.getParameter("id"))? Integer.parseInt(req.getParameter("id")) : null;
        ArrayList<MProcedureModule> mProcedureModules = procedureModuleService.initialModule(id);
        return mProcedureModules;
    }

}

